#!/bin/bash

export PATH=/home/hitmoon/.local/bin:$PATH
pushd /home/hitmoon/WeiboSpider
scrapy crawl weibo_spider
popd

pushd /home/hitmoon
./gen-news.sh
sed 'a\ ' out.csv > msg.txt
stamp=$(date +"%Y-%m-%d %H:%M:%S")
subject="News from weibo Bot ($stamp)"
python send_mail.py -m smtp.163.com -u user -p pass -F xxx@163.com -t xxx@qq.com -s "$subject" -f msg.txt
popd

exit $?

